﻿using Admin.ApplicationLib.Entities;
using Admin.CommonLib.Models.Organization;
using Ardalis.Specification;

namespace Admin.ApplicationLib.Specifications
{
    public class OrganizationSpecification : Specification<OrganizationEntity>
    {
        public OrganizationSpecification(OrganizationSearchRequestDto model)
        {
            if (model.Page > 0)
            {
                Query.Skip((model.Page - 1) * model.Limit);
            }

            if (model.Limit > 0)
            {
                Query.Take(model.Limit);
            }
        }
    }
}